<template>
  <article class="page mine-page" style="background-color: #fff;">
    <div class="header">
      <div @click="back()" class="back"><span class="arrow"></span></div>
      <div class="head-bd">
        我的支部
      </div>
      <div class="message"></div>
    </div>

    <section class="frame-content-sub no-bg">
      <div>
        <div class="pdv-2"></div>
        <div class="pdv-2"></div>
        <div class="avatar-img"><img src="../../../../static/images/dangjian/home/water-logo.png" alt=""></div>
      </div>
      <div class="bg-white text-center">
        <div class="pdv-1"></div>
        <h1 class="name">{{partInfo.fullname}}</h1>
        <div class="color-tip pdv-2">党员ID: {{partInfo.userId}}</div>

        <div class="props">
          <div class="item">
            <div class="value">{{getSex(partInfo.sex)}}</div>
            <div class="name">性别</div>
          </div>
          <div class="line"></div>
          <div class="item">
            <div class="value">{{partInfo.mz}}</div>
            <div class="name">民族</div>
          </div>
          <div class="line"></div>
          <div class="item">
            <div class="value">{{partInfo.dzbzw}}</div>
            <div class="name">党支部职务</div>
          </div>
          <div class="line"></div>
          <div class="item">
            <div class="value"><img class="more" src="../../../../static/images/dangjian/mine/more.png" alt=""></div>
            <div class="name">更多</div>
          </div>
        </div>
      </div>

      <div class="bg-default">


      <div class="pdv-2"></div>
      <div class="pdv-2"></div>
      <section class="block visible block-border">
        <div class="center-img">
          <div class="inner">
            <img src="../../../../static/images/dangjian/mine/zhibo-img.png" alt="">
          </div>
        </div>
        <section class="block-head text-center mgt-3 pdh-0">
          <div class="big-title">支部联系人</div>
        </section>

        <!--支部成员-->
        <section class="self-height mgt-2 pdh-2">
          <section class="people-list ">
            <div class="people-item" v-for="item in data">
              <section class="people-info">
                <div class="avatar-img">
                  <img src="../../../../static/images/default.jpg" alt="">
                </div>
                <span class="name">{{item.userName}}</span>
              </section>
              <span class=""><span class="tip pdh-2">{{item.mobile}}</span><span class="color-tip fa fa-phone-alt"></span></span>
            </div>
            <div class="text-center no-data" v-if="data.length===0">
              <img src="../../../../static/images/no_data.png" alt="">
              <p>暂无数据</p>
            </div>

          </section>
        </section>
      </section>
      </div>

    </section>
  </article>
</template>

<script>
  import tools from '@/utils/tools'
  import api from '@/common/config/api'
  import loginService from '@/service/loginService'
  export default {
    name: 'myBranch',
    data () {
      return {
        fn: tools,
        data: [],
        partInfo: {}
      }
    },
    created () {
      this.partInfo = this.$localStorage.get('partyInfo')
      this.loadData()
    },
    methods: {
      back () {
        this.tools.back()
      },
      loadData () {
        let data = {
          loginId: '3750'
        }
        this.fetchService.findDzbUserList(data).then(res => {
          if (res.code !== 0) {
            return tools.tip(res.message)
          }
          this.data = res.data
        })
      },
      getSex (sex) {
        if (sex === 'Male') {
          return '男'
        } else {
          return '女'
        }
      }
    }
  }
</script>

<style scoped lang="scss">
  @import "@/common/stylus/moon.scss";

  .mine-page{
    background: url("../../../../static/images/dangjian/mine/bg-mine-hd.png") #F5F5F5 no-repeat top center;
    background-size: 100% auto;
    padding:0;
    .header {
      background:none;
      justify-content: space-between;
      margin-bottom: pxToRem(0px);
    }
  }

  .avatar-img {
    margin:auto;
    width:118px;
    height:118px;
    border:4px solid rgba(255, 255, 255, 1);
    border-radius:100%;
    overflow: hidden;
    img {
      @include  fullImg();
    }
  }

  .block-head {
    font-size:pxToRem(30px);
    border-color:rgba(212,212,212,1);
    height:auto;
  }
  .big-title {
    text-align: center;
    width:100%;
    font-size:30px;
    font-weight:400;
    color:rgba(51,51,51,1);
    padding:25px 0 0;
  }
  .self-height {
    height: pxToRem(978px);
    overflow:scroll;
  }
  .block-border {
    border:8px solid $theme-color;

  }
</style>


